package com.jumper.study.front.dto.resp;

public class MyLessonChapterResp {
    private Long id;

    private String title;

    private String video;

    private Long duration;

    private Long studyTimes;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public Long getStudyTimes() {
        return studyTimes;
    }

    public void setStudyTimes(Long studyTimes) {
        this.studyTimes = studyTimes;
    }

    public Long getProgress() {
        if (duration == null || duration <= 0 || studyTimes == null || studyTimes <= 0) {
            return 0l;
        }

        Long percent = studyTimes * 100 / duration;
        return percent > 100 ? 100 : percent;
    }
    
}
